<?php
/*========================================= JooSam =========================================/
/																							/
/	Extention:		JooSam																	/
/	Created by:		ScriptPlanet.eu															/
/	Site:			http://www.scriptplanet.eu												/
/	Email:			support@scriptplanet.eu													/
/	Support:		http://www.scriptplanet.eu/support										/
/	Copyright:		2011 (c) ScriptPlanet.eu												/
/	License:		CC BY-NC-ND 3.0 ~ http://creativecommons.org/licenses/by-nc-nd/3.0/		/
/	File Version:	0002																	/
/																							/
/========================================== JooSam ========================================*/
// Joomla Security
defined('_JEXEC') or die;
JHTML::_('behavior.mootools');
jimport('joomla.application.component.helper');
if(JComponentHelper::isEnabled('com_joosam', true)):
	$partitle = $params->get('artTit');
	$parData = $params->get('artTxt');
	$parBg0 = $params->get('bgFirRow');
	$parBgHv0 = $params->get('bgFirRowHv');
	$parBg1 = $params->get('bgSecRow');
	$parBgHv1 = $params->get('bgSecRowHv');
	$jsmRequested_maxSongs = $params->get('requested_maxSongs', 5);
	echo '<style type="text/css">';
	echo '
	.jsm_toprequest .jsam_td .jsam_span_artist{ width:45%; margin:0; text-align:left; padding:0; color:#'.$partitle.'; }
	.jsm_toprequest .jsam_td .jsam_span_title{ width:45%; margin:0; padding:0; text-align:left; color:#'.$parData.'; }
	.jsm_toprequest .jsam_table{ text-align:left; width:100%; padding:0; }
	.jsm_toprequest .jsam_row_bg0, .jsam_mod_populate .jsam_row_bg1{ margin:0 0 5px 0; }';
	if($parBg0 != 'FFFFFF' AND $parBg0 != ''){ echo '.jsm_toprequest .jsam_row_bg0{ background:#'.$parBg0.'; margin:0; }'; }
	if($parBgHv0 != 'FFFFFF' AND $parBgHv0 != ''){ echo '.jsm_toprequest .jsam_row_bg0:hover{ background:#'.$parBgHv0.'; }'; }
	if($parBg1 != 'FFFFFF' AND $parBg1 != ''){ echo '.jsm_toprequest .jsam_row_bg1{ background:#'.$parBg1.'; margin:0; }'; }
	if($parBgHv1 != 'FFFFFF' AND $parBgHv1 != ''){ echo '.jsm_toprequest .jsam_row_bg1:hover{ background:#'.$parBgHv1.'; }'; }
	echo '</style>';
	?>
	<div id="jsm_toprequest" class="jsm_toprequest"></div><?php
	$joosam_plugin = JPluginHelper::isEnabled('system', 'joosam');
	if($joosam_plugin): ?>
		<script>
			var timer = 1000;
			var jsmRequested_maxSongs = <?php echo $jsmRequested_maxSongs; ?>;
			setTimeout('joosam.ajax_toprequest("jsm_toprequest", '+timer+', jsmRequested_maxSongs)', timer);
		</script> <?php
	else: ?>
		<div id="jsm_toprequest">
			<div style="background:white; color:red; font-weight:bold; border-radius:10px; margin:1px; text-align:center; padding:0;">
				<?php echo JText::_('MOD_JOOSAM_REQUESTED_NOPLUGIN'); ?>
			</div>
		</div><?php
	endif;
else: ?>
	<div id="jsm_toprequest">
		<div style="background:white; color:red; font-weight:bold; border-radius:10px; margin:1px; text-align:center; padding:0;">
			<?php echo JText::_('MOD_JOOSAM_REQUESTED_NOCOMPONENT'); ?>
		</div>
	</div><?php
endif;
?>